# define _CRT_SECURE_NO_WARNINGS 1
# include<stdio.h>
int sum(int x)
{
	int m = 0;
	if (x < 10)
	{
		return x % 10;
	}
	else
	{
		m = x % 10 + sum(x / 10);
	}
	return m;
}


int main()
{
	int n = 0;
	scanf("%d", &n);
    printf("%d", sum(n));

	return 0;
}